import type { PropertyListType, GetPropertyParamsType, EnterpriseType, buildingType, PaymentParamsType, AddPropertyParams } from "@/types/property"
import { request } from "@/utils/reuqest"


// 获取物业费账单API
export const getPropertyAPI = (params: GetPropertyParamsType) => {
    return request<PropertyListType>('/park/propertyfee', 'GET', params)
}

// 查询所有企业API
export const getEnterpriseDataAPI = () => {
    return request<EnterpriseType[]>('/park/all/enterprise', 'GET')
}

// 查询所有楼宇
export const getBuildingDataAPI = () => {
    return request<buildingType[]>('/park/all/building', 'GET')
}

// 预算金额
export const getPaymentAPI = (data: PaymentParamsType) => {
    return request<string>('/park/propertyfee/pre/payment', 'POST', data)
}

// 添加物业费
export const addPropertyAPI = (data: AddPropertyParams) => {
    return request('/park/propertyfee', 'POST', data)
}

// 删除物业费账单
export const deletePropertyAPI = (id: number) => {
    return request(`/park/propertyfee/${id}`, 'DELETE')
}
